package com.roncoo.education.course.service.dao.service.impl.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import com.roncoo.education.course.common.dto.CourseAppointmentDTO;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CourseAppointmentIntroduceVOMapper extends BaseMapper<CourseAppointmentIntroduceVOMapper> {

    @Select("SELECT  c.course_name, c.course_logo, c.open_class_date,i.introduce FROM course c LEFT JOIN course_user_study u ON c.id=u.course_id LEFT JOIN course_introduce_audit i ON c.introduce_id=i.id WHERE u.user_no=#{userNo} ORDER BY c.is_appointment, c.open_class_date")
    List<CourseAppointmentDTO>getPageList(Long userNo , Page page);
}
